﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkshopModule.Models;

namespace MonitorModule.Models {

    /// <summary>
    /// 车间数据模型
    /// </summary>
    [Table("WorkShopModel")]
    public partial class WorkShopModel:ObservableObject {

        //车间编号
        [Key]
        [ObservableProperty]
        private int _workShopId;

        /// <summary>
        /// 车间名称
        /// </summary>
        /// 
        [ObservableProperty]
        private string _workShopName;

        /// <summary>
        /// 作业数量
        /// </summary>
        /// 
        [ObservableProperty]
        private int _workingCount;


        /// <summary>
        /// 等待数量
        /// </summary>
        /// 
        [ObservableProperty]
        private int _waitCount;


        /// <summary>
        /// 故障数量
        /// </summary>
        /// 
        [ObservableProperty]
        private int _wrongCount;


        /// <summary>
        /// 停机数量
        /// </summary>
        /// 
        [ObservableProperty]
        private int _stopCount;


        /// <summary>
        /// 总数量（只读）,修改了,现在不是只读了
        /// </summary>
        /// 
        private int _TotalCount;
        public int TotalCount {
            get {
                return WorkingCount + WaitCount + WrongCount + StopCount;
            }
            set { _TotalCount = value; }
        }
        /// <summary>
        /// 该车间内的设备
        /// </summary>
        private ObservableCollection<DeviceDetail> _deviceList;


    }
}
